    $('document').ready(function () {
        var pm25Data = [],
            pm10Data = [],
            datatime = [],
            noise = [];
        var records = [{
            'dataTime': "20191211000021",
            'deviceId': "ET2154102",
            'humidity': 716,
            'noise': 400,
            'o3': 0,
            'pm10': 982,
            'pm25': 432,
            'temperature': 54,
            'tsp': 0,
            'windFlag': 1621,
            'windSpeed': 0
        }, {
            'dataTime': "20191211010021",
            'deviceId': "ET2154102",
            'humidity': 729,
            'noise': 400,
            'o3': 0,
            'pm10': 954,
            'pm25': 411,
            'temperature': 46,
            'tsp': 0,
            'windFlag': 1807,
            'windSpeed': 0
        }, {
            'dataTime': "20191211020021",
            'deviceId': "ET2154102",
            'humidity': 755,
            'noise': 400,
            'o3': 0,
            'pm10': 984,
            'pm25': 402,
            'temperature': 43,
            'tsp': 0,
            'windFlag': 1550,
            'windSpeed': 0
        }, {
            'dataTime': "20191211030021",
            'deviceId': "ET2154102",
            'humidity': 757,
            'noise': 400,
            'o3': 0,
            'pm10': 974,
            'pm25': 400,
            'temperature': 38,
            'tsp': 0,
            'windFlag': 1584,
            'windSpeed': 0
        }, {
            'dataTime': "20191211040021",
            'deviceId': "ET2154102",
            'humidity': 756,
            'noise': 400,
            'o3': 0,
            'pm10': 1024,
            'pm25': 421,
            'temperature': 34,
            'tsp': 0,
            'windFlag': 1588,
            'windSpeed': 0,
        }, {
            'dataTime': "20191211050021",
            'deviceId': "ET2154102",
            'humidity': 770,
            'noise': 400,
            'o3': 0,
            'pm10': 1106,
            'pm25': 436,
            'temperature': 29,
            'tsp': 0,
            'windFlag': 1593,
            'windSpeed': 0
        }, {
            'dataTime': "20191211060021",
            'deviceId': "ET2154102",
            'humidity': 773,
            'noise': 400,
            'o3': 0,
            'pm10': 1196,
            'pm25': 467,
            'temperature': 19,
            'tsp': 0,
            'windFlag': 1764,
            'windSpeed': 0
        }, {
            'dataTime': "20191211070021",
            'deviceId': "ET2154102",
            'humidity': 770,
            'noise': 400,
            'o3': 0,
            'pm10': 1189,
            'pm25': 459,
            'temperature': 18,
            'tsp': 0,
            'windFlag': 1776,
            'windSpeed': 0
        }, {
            'dataTime': "20191211080021",
            'deviceId': "ET2154102",
            'humidity': 774,
            'noise': 400,
            'o3': 0,
            'pm10': 1326,
            'pm25': 492,
            'temperature': 17,
            'tsp': 0,
            'windFlag': 1813,
            'windSpeed': 0
        }];
        for (var i = 0; i < records.length; i++) {
            // if (obj == 1 || obj == 3) {
            //     datatime.push(data[i].dataTime.slice(6, 8))
            // } else if (obj == 2 || obj == 4) {
            //     datatime.push(data[i].dataTime.slice(8, 10))
            // } else {
            //     datatime.push(data[i].dataTime.slice(8, 10))
            // }

            pm25Data.push(records[i].pm25 / 10)
            pm10Data.push(records[i].pm10 / 10)
            noise.push(records[i].noise / 10)
        }
        // switch (obj) {
        //     case 1:
        //         _this.noiseStatistics1();
        //         break;
        //     case 2:
        //         _this.noiseStatistics1();
        //         break;
        //     case 3:
        //         _this.noiseStatistics2();
        //         break;
        //     case 4:
        //         _this.noiseStatistics2();
        //         break;
        //     default:
        //         _this.noiseStatistics1();
        //         _this.noiseStatistics2();
        //         _this.noiseStatistics3();
        //         break;
        // }
        //今日报警信息滚动
        var lefttop = $('.table-body')[0];
        var parentBox = lefttop.parentNode.clientHeight;
        var SPEED = 50;
        var interval = setInterval(function () {
            move(lefttop)
        }, SPEED);
        if (parentBox <= lefttop.clientHeight) {
            clearInterval(interval);
        } else {
            clearInterval(interval);
            interval = setInterval(function () {
                move(lefttop)
            }, SPEED);
            lefttop.addEventListener("mouseenter", function () {
                clearInterval(interval);
            })
            lefttop.addEventListener("mouseleave", function () {
                clearInterval(interval);
                interval = setInterval(function () {
                    move(lefttop)
                }, SPEED);
            })
        }
        //今日报警信息滚动函数
        function move(lefttop) {
            lefttop.style.marginTop = parentBox + "px";
            parentBox -= 1;
            if (parentBox <= -lefttop.clientHeight) {
                parentBox = lefttop.parentNode.clientHeight;
            }
        }
        //仪表盘
        ybp();

        function ybp() {
            var ybpaqi = echarts.init(document.getElementById('ybp'));
            ybpaqi.resize();
            var option = {
                tooltip: {
                    formatter: "{a} <br/>{b} : {c}"
                },
                toolbox: {
                    show: true,
                },
                series: [{
                    name: 'AQI',
                    type: 'gauge',
                    center: ['50%', '40%'], // 默认全局居中
                    radius: '70%',
                    startAngle: 140,
                    endAngle: -140,
                    min: 0, // 最小值
                    max: 500, // 最大值
                    precision: 0, // 小数精度，默认为0，无小数点
                    splitNumber: 10, // 分割段数，默认为5
                    axisLine: { // 坐标轴线
                        show: true, // 默认显示，属性show控制显示与否
                        lineStyle: { // 属性lineStyle控制线条样式
                            color: [
                                [0.1, '#a7cf50'],
                                [0.2, '#f8d700'],
                                [0.3, '#ff9900'],
                                [0.4, '#FF6600'],
                                [0.6, '#DD2C03'],
                                [1, '#6C210F']
                            ],
                            width: 20
                        }
                    },
                    axisTick: { // 坐标轴小标记
                        show: true, // 属性show控制显示与否，默认不显示
                        splitNumber: 5, // 每份split细分多少段
                        length: 8, // 属性length控制线长
                        lineStyle: { // 属性lineStyle控制线条样式
                            color: '#fff',
                            width: 1,
                            type: 'solid'
                        }
                    },
                    axisLabel: { // 坐标轴文本标签，详见axis.axisLabel
                        show: false,
                        formatter: function (v) {
                            switch (v + '') {
                                case '50':
                                    return '优';
                                case '100':
                                    return '良';
                                case '150':
                                    return '轻度';
                                case '200':
                                    return '中度';
                                case '300':
                                    return '重度';
                                case '500':
                                    return '严重';
                                default:
                                    return '';
                            }
                        },
                        textStyle: { // 其余属性默认使用全局文本样式，详见TEXTSTYLE
                            color: '#fff'
                        }
                    },
                    splitLine: { // 分隔线
                        show: true, // 默认显示，属性show控制显示与否
                        length: 30, // 属性length控制线长
                        lineStyle: { // 属性lineStyle（详见lineStyle）控制线条样式
                            color: '#fff',
                            width: 2,
                            type: 'solid'
                        }
                    },
                    pointer: {
                        length: '80%',
                        width: 8,
                        color: 'auto'
                    },
                    title: {
                        show: true,
                        offsetCenter: ['-65%', -10], // x, y，单位px
                        textStyle: { // 其余属性默认使用全局文本样式，详见TEXTSTYLE
                            color: '#fff',
                            fontSize: 16
                        }
                    },
                    detail: {
                        show: true,
                        backgroundColor: 'rgba(0,0,0,0)',
                        borderWidth: 0,
                        borderColor: '#fff',
                        //              height: 10,
                        offsetCenter: ['-60%', 10], // x, y，单位px
                        formatter: '{value}',
                        textStyle: { // 其余属性���认使用全局文本样式，详见TEXTSTYLE
                            color: 'auto',
                            fontSize: 20,
                        },
                    },
                    data: [{
                        //              value: aqinum, //后台获取AQI赋值给他
                        value: '32.43', //后台获取AQI赋值给他
                        name: 'AQI：'
                    }]
                }]
            };
            ybpaqi.setOption(option, true);
            window.addEventListener("resize", function () {
                ybpaqi.resize();
            });
        }
        noise1();

        function noise1() {
            var noise1 = echarts.init(document.getElementById('noise1'));
            var option = {
                grid: {
                    left: 50,
                    top: 30,
                    right: 10,
                    bottom: 60
                },
                legend: {
                    data: [{
                            name: 'PM2.5',
                            textStyle: {
                                color: '#fff'
                            }
                        },
                        {
                            name: 'PM10',
                            // 设置文本为红色
                            textStyle: {
                                color: '#fff'
                            }
                        }

                    ],
                    left: 10
                },
                tooltip: {
                    show: true
                },
                dataZoom: {
                    show: true,
                    height: 10,
                    bottom: 25,
                    start: 0,
                    end: 90 //初始化滚动条
                },
                xAxis: {
                    type: 'category',
                    boundaryGap: false,
                    data: [00, 01, 02, 03, 04, 05, 06, 07, 08],
                    axisLabel: {
                        show: true,
                        textStyle: {
                            color: "#fff"
                        }
                    },
                    axisTick: {
                        show: false
                    }
                },
                yAxis: {
                    type: 'value',
                    axisLabel: {
                        show: true,
                        textStyle: {
                            color: "#fff"
                        }
                    },
                    axisTick: {
                        show: false
                    },
                    splitLine: {
                        show: false
                    }
                },
                series: [{
                        name: 'PM2.5',
                        type: 'line',
                        symbol: "circle",
                        data: [43.2, 41.1, 40.2, 40, 42.1, 43.6, 46.7, 45.9, 49.2],
                        areaStyle: {
                            normal: {}
                        },
                        color: '#90D2FC',
                        markPoint: {
                            symbolSize: 30,
                            label: {
                                fontSize: 10
                            },
                            data: [{
                                type: 'max',
                                name: '最大值'
                            }]
                        }
                    },
                    {
                        name: 'PM10',
                        type: 'line',
                        symbol: "circle",
                        data: [98.2, 95.4, 98.4, 97.4, 102.4, 110.6, 119.6, 118.9, 132.6],
                        areaStyle: {
                            normal: {}
                        },
                        color: '#FD7E50',
                        markPoint: {
                            symbolSize: 30,
                            label: {
                                fontSize: 10
                            },
                            data: [{
                                type: 'max',
                                name: '最大值'
                            }]
                        }
                    }
                ]
            }
            noise1.setOption(option, true);
            window.addEventListener("resize", function () {
                noise1.resize();
            });

        }

        noise2();
        //24小时噪音统计
        function noise2() {

            var noise2 = echarts.init(document.getElementById('noise2'));

            var option2 = {
                grid: {
                    left: 30,
                    top: 30,
                    right: 10,
                    bottom: 60
                },
                legend: {
                    data: [{
                        name: '噪音',
                        textStyle: {
                            color: '#fff'
                        }
                    }],
                    left: 10
                },
                tooltip: {
                    show: true
                },
                dataZoom: {
                    show: true,
                    height: 10,
                    bottom: 30,
                    start: 0,
                    end: 90 //初始化滚动条
                },
                xAxis: {
                    type: 'category',
                    boundaryGap: false,
                    data: [],
                    axisLabel: {
                        color: "#ddd"
                    },
                    axisTick: {
                        show: false
                    }
                },
                yAxis: {
                    type: 'value',
                    axisLabel: {
                        color: "#ddd"
                    },
                    axisTick: {
                        show: false
                    },
                    splitLine: {
                        show: false
                    }
                },
                series: [{
                    name: '噪音',
                    type: 'line',
                    symbol: "circle",
                    data: ['2', '8', '10'],
                    areaStyle: {},
                    color: '#90D2FC',
                    markPoint: {
                        symbolSize: 30,
                        label: {
                            fontSize: 10
                        },
                        data: [{
                            type: 'max',
                            name: '最大值'
                        }]
                    }
                }]
            }
            noise2.setOption(option2, true);
            window.addEventListener("resize", function () {
                noise2.resize();
            });
        }
        noise3();
        //15天AQI指数
        function noise3() {
            var aqi = echarts.init(document.getElementById('noise3'));
            var option3 = {
                grid: {
                    left: 30,
                    top: 30,
                    right: 10,
                    bottom: 60
                },
                legend: {
                    data: [{
                        name: 'AQI',
                        textStyle: {
                            color: '#fff'
                        }
                    }],
                    left: 10
                },
                tooltip: {
                    show: true
                },
                dataZoom: {
                    show: true,
                    height: 10,
                    bottom: 30,
                    start: 0,
                    end: 90 //初始化滚动条
                },
                xAxis: {
                    type: 'category',
                    boundaryGap: false,
                    data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
                    axisLabel: {
                        color: "#fff"
                    },
                    axisTick: {
                        show: false
                    }
                },
                yAxis: {
                    type: 'value',
                    axisLabel: {
                        color: "#ddd"
                    },
                    axisTick: {
                        show: false
                    },
                    splitLine: {
                        show: false
                    }
                },
                series: [{
                    name: 'AQI',
                    type: 'line',
                    symbol: "circle",
                    data: ['10', '12'],
                    areaStyle: {},
                    color: '#90D2FC',
                    markPoint: {
                        symbolSize: 30,
                        label: {
                            fontSize: 10
                        },
                        data: [{
                            type: 'max',
                            name: '最大值'
                        }]
                    }
                }]
            }
            aqi.setOption(option3, true);
            window.addEventListener("resize", function () {
                aqi.resize();
            });
        }
    })